1. Field of the Invention
The present invention relates to computer communication, and deals more particularly with a technique, system, and computer program for enhancing performance of the computers in a Web environment. This is done by creating a pool of connections between a Web server and backend data servers, reducing the overhead required for accessing the data servers and enabling the applications running on the Web server to be faster. A common interface to the pool is used, regardless of the type of backend data server connection, making programs which use the pool easier (and therefore less costly) to write and support.
2. Description of the Related Art
The Internet is a vast collection of computing resources, interconnected as a network, from sites around the world. It is used every day by millions of people. The World Wide Web (referred to herein as the "Web") is that portion of the Internet which uses the HyperText Transfer Protocol ("HTTP") as a protocol for exchanging messages. (Alternatively, the "HTTPS" protocol can be used, where this protocol is a security-enhanced version of HTTP.)
A user of the Internet typically accesses and uses the Internet by establishing a network connection through the services of an Internet Service Provider (ISP). An ISP provides computer users the ability to dial a telephone number using their computer modem (or other connection facility, such as satellite transmission), thereby establishing a connection to a remote computer owned or managed by the ISP. This remote computer then makes services available to the user's computer. Typical services include: providing a search facility to search throughout the interconnected computers of the Internet for items of interest to the user; a browse capability, for displaying information located with the search facility; and an electronic mail facility, with which the user can send and receive mail messages from other computer users.
The user working in a Web environment will have software running on his computer to allow him to create and send requests for information, and to see the results. These functions are typically combined in what is referred to as a "Web browser", or "browser". After the user has created his request using the browser, the request message is sent out into the Internet for processing. The target of the request message is one of the interconnected computers in the Internet network. That computer will receive the message, attempt to find the data satisfying the user's request, format that data for display with the user's browser, and return the formatted response to the browser software running on the user's computer.
This is an example of a client-server model of computing, where the machine at which the user requests information is referred to as the client, and the computer that locates the information and returns it to the client is the server. In the Web environment, the server is referred to as a "Web server". The client-server model may be extended to what is referred to as a "three-tier architecture". This architecture places the Web server in the middle tier, where the added third tier typically represents data repositories of information that may be accessed by the Web server as part of the task of processing the client's request. This three-tiered architecture recognizes the fact that many client requests do not simply require the location and return of static data, but require an application program to perform processing of the client's request in order to dynamically create the data to be returned. In this architecture, the Web server may equivalently be referred to as an "application server", reflecting the fact that this middle tier is where the business logic of the application typically resides, and the computers on which the data repositories reside may be referred to as "data servers", or "backend data servers". A data server stores and manages the data that is used by an application, and as used herein, includes the software products that are used in storing, accessing, and retrieving the data. Commonly, a relational database product, such as DB2 from the International Business Machines Corporation ("IBM"), will be used. However, other products which provide services for managing and accessing data may also be considered as falling within the scope of data servers, including messaging products such as MQSeries and CICS from IBM, as well as other types of middleware. DB2, MQSeries, and CICS are registered trademarks of IBM.
The Java programming language is gaining wide acceptance for writing Web applications, as it is a robust portable object-oriented language defined specifically for the Web environment. ("Java" is a trademark of Sun Microsystems, Inc.) Java attains its portability through use of a specially-designed virtual machine. A Web server that implements a Java virtual machine can be functionally extended using Java "servlets". A servlet is a relatively small executable code object that can be dynamically plugged in, or added, to the code running on the server. Servlets typically perform some specialized function, which can be invoked by the server (or by another servlet) to extend its own functionality. The servlet processes the request, and returns the response to the server (or servlet) that invoked it.
Because Web applications typically have a human user waiting for the response to the client requests, responses must be returned very quickly, or the user will become dissatisfied with the service. Usage volumes for a server may be very large: a particular server may receive thousands, or even millions, of client requests in a day's time. These requests must all be handled with acceptable response times, or the users may switch to a competitor's application services. When the request involves accessing and retrieving data from a backend server, as it normally will, the Web server must first establish a connection to the data server. This connection process may involve sending and receiving a number of messages. For example, a name server might need to be contacted by the Web server, to determine the network address of the desired data server. After receiving a network address, the Web server sends a connection request to the data server. The details of the request depend on the specific type of data server and the networking protocol used to access it, but it is possible that more than one sequence of connection request and connection response messages may need to be exchanged (for example, to negotiate the details of the connection type) between the Web server and the data server before a connection can be completed. When the client request has been completed, the connection must then be disconnected, involving additional message exchanges between the Web server and data server. The messages involved in connecting and disconnecting add a significant amount of overhead to the processing of a client's request, and may greatly outweigh the time actually spent in completing the transaction that answers the client's query.
Accordingly, a need exists for a technique by which these performance problems in the current implementations of Web and data servers can be overcome. The present invention deals with a technique for maintaining connections, after processing of the client request has been completed. Existing connections are maintained in a connection pool. When a client request is received, a connection from the pool is used if a suitable connection is available--thus avoiding the overhead of establishing the connection. (When no connection from the pool can be used, a new connection may be established.) This pool may contain many connections to a single data server, many connections to multiple data servers of a single type (such as multiple DB2 databases), and/or many connections to data servers of different types (for example, DB2 databases, MQSeries message services, etc.). A common interface is used for requesting a connection from the pool, reducing the number of APIs (Application Programming Interfaces) that programmers and support personnel are required to understand and use. This will make working with the pool easier, which will in turn reduce development and support costs.